package com.smart.platform.controller;

import com.smart.platform.common.Result;
import com.smart.platform.common.wenxin.WenXinParam;
import com.smart.platform.common.wenxin.WenXinReponse;
import com.smart.platform.service.WenXinService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@Api(tags = "文心一言调用接口")
@RequestMapping("/wenXin")
public class WenXinController {

    @Autowired
    private WenXinService wenXinService;

    @ApiOperation(value = "文心一言调用 返回固定格式的回答内容")
    @PostMapping("/reply")
    public Result<WenXinReponse> reply(@RequestBody WenXinParam wenXinParam){

        WenXinReponse wenXinReponse = wenXinService.dealQuestion(wenXinParam.getQuestion(),wenXinParam.getValueMax(),wenXinParam.getAnswer());
        return Result.success(wenXinReponse);
    }


}
